import React, { PureComponent } from "react"
import classNames from "classnames"

export class App extends PureComponent {
    constructor() {
        super()

        this.state = {
            isbbb: true,
        }
    }

    render() {
        const { isbbb } = this.state
        const classList = ["aaa"]
        if (isbbb) classList.push("bbb")

        return (
            <div>
                <h2 className={`aaa ${isbbb ? "bbb" : ""}`}>哈哈哈</h2>
                <h2 className={`${classList.join(" ")}`}>呵呵呵</h2>
                <h2
                    className={classNames("aaa", {
                        bbb: isbbb,
                    })}
                >
                    嘿嘿嘿
                </h2>
            </div>
        )
    }
}

export default App
